public class Date {
    public int year;
    public int month;
    public int day;


    /*public void setDate(int y,int m,int d) {
        year = y;
        month = m;
        day = d;
    }*/

    //this代表当前对象的引用，建议大家 习惯使用this  谁调用了当前的set方法 谁就是this
    public void setDate(/*Date this,*/int year,int month,int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void printDate() {
        System.out.println("年："+ this.year+" 月："
                +this.month+" 日："+this.day);
    }

    public static void main(String[] args) {
        Date date = new Date();
        date.setDate(2008,8,8);
        date.printDate();
        System.out.println("============");
        Date date2 = new Date();
        //setDate方法里面的this 就是谁调用过了这个方法
        date2.setDate(2009,9,9);
        date2.printDate();
    }

}

